package gitlet;

import java.io.File;

/** Driver class for Gitlet, a subset of the Git version-control system.
 *  @author Mark Zhang
 */
public class Main {
    /** Usage: java gitlet.Main ARGS, where ARGS contains
     *  <COMMAND> <OPERAND1> <OPERAND2> ... 
     */
    public static void main(String[] args) {
        Repository gitlet = new Repository();
        String firstArg = args[0];
        switch (firstArg) {
        case "init":
            gitlet.init();
            break;
        case "add":
            gitlet.add(args[1]);
            break;
        case "commit":
            gitlet.commit(args[1]);
            break;
        case "rm":
            gitlet.rm(args[1]);
            break;
        case "log":
            gitlet.log();
            break;
        case "global-log":
            gitlet.global_log();
            break;
        case "find":
            gitlet.find(args[1]);
            break;
        case "status":
            gitlet.status();
            break;
        case "checkout":
            //TODO: Implement checkout
            break;
        case "branch":
            gitlet.branch(args[1]);
            break;
        case "rm-branch":
            gitlet.rm_branch(args[1]);
            break;
        case "reset":
            gitlet.reset(args[1]);
            break;
        case "merge":
            gitlet.merge(args[1]);
            break;
        default:
            System.out.println("No command with that name exists.");
            break;
        }
    }
}
